home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / EDITORS / ZAP / !Zap / Docs / Commands next >
Text File  |  1995-05-14  |  4KB  |  87 lines

  1. *************************************************************************
  2. * >Commands    Help on command syntax                    *
  3. *************************************************************************
  4.  
  5. This gives details of the syntax you must use when typing a command into the
  6. 'keys' file or at the ctrl-Escape prompt. The file 'HelpData' contains a list
  7. of all the valid commands in the Zap and ZapBasic modules. The file
  8. 'E-Command' gives technical details on how to write your own commands.
  9. Also, see section C of the 'ReadMe' file.
  10.  
  11. Syntax
  12. ======
  13.  
  14. Command names are not case sensitive when typed into the keys file. Each
  15. command can take a parameter. The four types of parameter will be indicated
  16. after the command in the following way:
  17.  
  18.     WIBBLE            Command Wibble takes no parameter
  19.     WIBBLE <byte>        Command Wibble takes a single byte
  20.     WIBBLE <word>        Command Wibble takes a word (4 bytes)
  21.     WIBBLE <string>        Command Wibble takes a string argument
  22.     
  23. When you type the command into the keys file, or at the 'Command:' prompt,
  24. you type the command name, followed by a space and its parameter. Byte and
  25. word parameters must be preceded by an '&' if in hex. String parameters must
  26. be in double quotes. Double quotes can be included in strings by doubling
  27. them up. 'x' (single quotes included) is evaluated to the ascii value of the
  28. character x.
  29.  
  30. An error is given if the parameter you place after the command does
  31. not match the type of the command. There are several special cases:
  32.  
  33.  1 If the command takes a string parameter, but you omit the string, then a
  34.    minibuffer will be opened for you to type the string into when the command
  35.    is executed. For example, see the command SEARCHFORWARD (Ctrl-S).
  36.    
  37.  2 If the command takes a byte or word parameter and you specify 'n' as the
  38.    parameter, then the keynumber of the key you bind the command to is
  39.    substituted for the 'n'. For example, see the command CHAR.
  40.    
  41.  3 The '*' command. This is used for duplicating a range keypad entries.
  42.    The format of the command is *n where n is optional. 'n' is the key code
  43.    (or first key code of a list) of the key (or keys) to copy.
  44.    It is of the form &yy0xxx where yy is the keymap number and xxx the key
  45.    number. The default value of n is the current key being bound in keymap
  46.    0 (ie with yy set to 00).
  47.    Eg the line  "&20170-&2017F    *&40"  will cause keys &170-&17F in keymap
  48.    2 to have their definitions copied from keys &40-&4F of keymap 0.
  49.    
  50.  4 If you type a command into a keys file and it doesn't exist, then no error
  51.    will be given. This is so you can put commands in your keys file for
  52.    extension modes that may not always be loaded. However, if a command does
  53.    exist but its parameters are incorrect, then an error will be given.
  54.    
  55.  5 If you define a key twice, then the later one will be used. Ie, the keys
  56.    file is read sequentially and new definitions overwrite the old ones.
  57.  
  58. Commands can be chained together by use of the separator ':' as in BASIC. You
  59. may NOT chain together commands which use the minibuffer (ie commands which
  60. take a string as parameter but with the string unspecified). The two commands
  61. BASEMAP and KEYMAP provide a means of swapping from one keymap to another and
  62. for providing multiple key press commands as you get in Emacs. See the Emacs
  63. keymap for examples of their use.
  64.  
  65. Examples:
  66.  
  67.  (1)    &020-7E        CHAR n
  68.  (2)    &013        SEARCHFORWARD
  69.  (3)    &131        BASEMAP 1
  70.  (4)    &10018        KEYMAP 2
  71.  (5)    &10150-&101FF    *
  72.  (6)    &132        INSERT "Hello" : UP : RIGHT
  73.  (7)    &133        insert " ""hello"" "
  74.  (8)    &120        CHAR '('
  75.  
  76. In (1), key &20 (space) is assigned the command CHAR &20, key &21 (!) is
  77. assigned the command CHAR &21 etc. In (2), no string is given after
  78. SEARCHFORWARD, so you are prompted for it when you press cS. (3) Ensures all
  79. further keypresses are looked up in keymap 1, thus switching to Emacs
  80. emulation mode. (4) Switches to keymap 2 for the next key press only, thus
  81. allowing for two-key commands beginning with ctrl-X. In (5), keys &150-&1FF
  82. in keymap 1 are assigned to the same commands they have in keymap 0. (6)
  83. inserts the string "Hello" into the file and then moves up then right. (7)
  84. inserts the string ' "Hello" ' delimited by the single quotes. (8) Inserts a
  85. left bracket.
  86.  
  87.